<!-- 我我处理的-店铺详情组件 -->
<template name="mydealdetailCom2">
	<view class="mydealdetailCom mydealdetailCom2">
		<view class="content">
			<view class="list">
				<view class="list_item">
					<view class="item_title">{{infoData.field_val}}</view>
					<view class="item_text" v-if="infoData.field_val == '备货时长'">
						{{infoData.new_content}}
						<text>分钟</text>
					</view>
					<view class="item_text" v-else-if="infoData.field_val == '店铺头像'"
					 style="color: #007AFF;" @click="previewImg(infoData.new_content)">
						查看头像
						<!-- <image :src="infoData.new_content"></image> -->
					</view>
					<view class="item_text" v-else>
						{{infoData.new_content}}
					</view>
				</view>
			</view>
			<view class="list">
				<view class="list_item">
					<view class="item_title">BD</view>
					<view class="item_text">{{infoData.db_info}}</view>
				</view>
				<view class="list_item">
					<view class="item_title">门店地址</view>
					<view class="item_text">{{infoData.shop_address}}</view>
				</view>
				<view class="list_item">
					<view class="item_title">提交时间</view>
					<view class="item_text">{{infoData.create_time}}</view>
				</view>
			</view>
			<view class="list">
				<view class="list_item">
					<view class="item_title">备注</view>
					<view class="item_text">
						<input type="text" :disabled="dealtype != 0" v-model="remark"  :placeholder="dealtype == 0?'不超过50字':''" />
					</view>
				</view>
			</view>
		</view>
		<view class="btn" v-if="dealtype == 0">
			<button type="default" class="btn_reject" @click="audit(-1)">审核拒绝</button>
			<button type="primary" @click="audit(1)">审核通过</button>
		</view>
	</view>
</template>

<script>
	import { wmmodifyverify } from '../../../api/index.js'
	export default {
		data() {
			return {
				remark:''
			}
		},
		props: {
			infoData:'',
			dealtype:''
		},
		methods: {
			audit:function(status){
				if(this.remark.length>50){
					uni.showTabBar({
						icon:'none',
						title:'备注字数不可超过50个'
					})
					return ;
				}
				wmmodifyverify({
					status:status,
					id:this.infoData.id,
					remarks:this.remark
				}).then((res) => {
					console.log(res)
					uni.showModal({
						title:'提示',
						content: res.msg,
						complete:function(){
							if(res.code == 0){
								uni.navigateBack({
									
								})
							}
						}
					})
				}).catch((e) => {
					console.log(e);
				})
			},
			previewImg:function(url){
				uni.previewImage({
					urls:[url]
				})
			}
		},
		watch:{
			infoData:function(){
				this.infoData.remarks = this.remark
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import './mydealdetailCom.scss';
	
	.item_text{
		image{
			width: 50rpx;
			height: 50rpx;
		}
	}
</style>